/*
 * Copyright 2009 fearsomeJ.org
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.fearsomej.jayme.process;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;

import javax.xml.bind.annotation.XmlRootElement;
//TODO finish javadocs
//TODO fix param names
/**
 * The context a particular {@link ProcessStep} is running under.
 * 
 * @author Kevin Beddingfield
 *
 */
@XmlRootElement(name="context")
public class ExecutionContext {
	private Map<Serializable, Serializable> contextMap;
	
	public ExecutionContext() {
		super();
		contextMap = new HashMap<Serializable, Serializable>();		
	}
	
	/**
	 * 
	 * @see java.util.Map#clear()
	 */
	public void clear() {
		contextMap.clear();
	}

	/**
	 * @param arg0
	 * @return
	 * @see java.util.Map#containsKey(java.lang.Object)
	 */
	public boolean containsKey(Object arg0) {
		return contextMap.containsKey(arg0);
	}

	/**
	 * @param arg0
	 * @return
	 * @see java.util.Map#containsValue(java.lang.Object)
	 */
	public boolean containsValue(Object arg0) {
		return contextMap.containsValue(arg0);
	}

	/**
	 * @return
	 * @see java.util.Map#entrySet()
	 */
	public Set<Entry<Serializable, Serializable>> entrySet() {
		return contextMap.entrySet();
	}

	/**
	 * @param arg0
	 * @return
	 * @see java.util.Map#equals(java.lang.Object)
	 */
	public boolean equals(Object arg0) {
		return contextMap.equals(arg0);
	}

	/**
	 * @param arg0
	 * @return
	 * @see java.util.Map#get(java.lang.Object)
	 */
	public Serializable get(Object arg0) {
		return contextMap.get(arg0);
	}

	/**
	 * @return
	 * @see java.util.Map#isEmpty()
	 */
	public boolean isEmpty() {
		return contextMap.isEmpty();
	}

	/**
	 * @return
	 * @see java.util.Map#keySet()
	 */
	public Set<Serializable> keySet() {
		return contextMap.keySet();
	}

	/**
	 * @param arg0
	 * @param arg1
	 * @return
	 * @see java.util.Map#put(java.lang.Object, java.lang.Object)
	 */
	public Serializable put(Serializable arg0, Serializable arg1) {
		return contextMap.put(arg0, arg1);
	}

	/**
	 * @param arg0
	 * @see java.util.Map#putAll(java.util.Map)
	 */
	public void putAll(Map<? extends Serializable, ? extends Serializable> arg0) {
		contextMap.putAll(arg0);
	}

	/**
	 * @param arg0
	 * @return
	 * @see java.util.Map#remove(java.lang.Object)
	 */
	public Serializable remove(Object arg0) {
		return contextMap.remove(arg0);
	}

	/**
	 * @return
	 * @see java.util.Map#size()
	 */
	public int size() {
		return contextMap.size();
	}

	/**
	 * @return
	 * @see java.util.Map#values()
	 */
	public Collection<Serializable> values() {
		return contextMap.values();
	}


	
	
}
